package com.xbongbong.sso.service;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.sso.domain.entity.XbbUserEntity;
import com.xbongbong.sso.pojo.dto.GetOauthConnectorDTO;
import com.xbongbong.sso.pojo.dto.UserOauthDTO;
import com.xbongbong.sso.pojo.vo.GenerateNonceVO;
import com.xbongbong.sso.pojo.vo.GetOauthConnectorVO;
import com.xbongbong.sso.pojo.vo.OauthFlowVO;
import com.xbongbong.sso.pojo.vo.UserOauthVO;

/**
 * 登录过程
 * 创建时间 2020/12/15 10:48 AM
 * 修改时间 2020/12/15 10:48 AM
 * @author chy
 */
public interface OauthFlowService {

    /**
     * 通过connectorSign获取授权连接器
     * @param getOauthConnectorDTO
     * @return
     */
    GetOauthConnectorVO getOauthConnector(GetOauthConnectorDTO getOauthConnectorDTO) throws XbbException;

    /**
     * 用户授权完成后
     * @param connectorSign
     * @param jsonObject
     * @return
     */
    OauthFlowVO oauthFlow(String connectorSign, JSONObject jsonObject) throws XbbException;

    GenerateNonceVO generateNonce(XbbUserEntity user) throws XbbException;

    UserOauthVO userOauth(UserOauthDTO userOauthDTO) throws XbbException;

    String getRedirectLoginUrl(String sign) throws XbbException;
}
